/**
 * Copyright (c) 2010
 * Bert Young. UESTC. 
 */

#ifndef BERT_GATEWAYTASK_H
#define BERT_GATEWAYTASK_H

#include "TCPTask.h"

class GatewayTask : public TCPTaskBuffer
{
public:
	/**
	 * Constructor
	 */
	GatewayTask(int localfd = -1, const struct sockaddr_in * client=NULL, bool buffer = false);
	/**
	 * 先收到客户传来的验证消息；通过后，将自己进入okay状态
	 * 回一个消息给客户，然后调用addcontainer把自己放入到taskManager中
	 */
	virtual int verifyConn();

	virtual bool addToContainer();

	virtual bool removeFromContainer();

	void msgParse(const void * cmd, unsigned int len);
};

#endif

